package com.ntschy.taizhou.service1;

public abstract class AbsInventorySimpleRule {


//    public  Object execute(Object ruleContext ) throws Exception {
//        System.out.println("----AbsInventorySimpleRule,,--execute--");
//
//        Object aa=new Object();
//        boolean isContinue = beforeExecute(aa, aa);
//        if (!isContinue) {
//
//        }
//
//         afterExecute(aa, aa, aa);
//         return   aa ;
//    }


    /**
     * 子表字段
     *
     * @return 子表字段
     */
    protected String getChildField() {
        return "bodyvos";
    }

    /**
     * 执行前
     *
     * @param ruleContext 规则上下文
     * @param headVOList  bills
     * @throws Exception 异常
     */
    protected boolean beforeExecute(Object ruleContext, Object headVOList) throws Exception {
        System.out.println("----AbsInventorySimpleRule,,--beforeExecute--");

        return true;
    }

    /**
     * 执行
     *
     * @param headVO 每个VO
     * @return 返回值
     * @throws Exception 异常
     */
    protected abstract Object execute(Object headVO ) throws Exception;

    /**
     * 执行后
     *
     * @param ruleContext 规则上下文
     * @param resultList  execute返回值集合
     * @param headVOList  bills
     * @throws Exception 异常
     */
    protected void afterExecute(Object ruleContext,  Object resultList, Object headVOList) throws Exception {
        // default do nothing
        System.out.println("----AbsInventorySimpleRule,,--afterExecute--");

    }

    /**
     * 设置返回值
     *
     * @param ruleContext 规则上下文
     * @param returnData  返回值
     */
    public void setReturnData(Object ruleContext, Object returnData) {

    }

    public Object getReturnData(Object ruleContext) {
        return new Object();
    }
}
